﻿/// <reference path="../../Templates/Include-Templates/navigation-list.html" />
angular.module('picShare').directive('navigationList', function (logoutSvc) {
    return {
        restrict: 'C',
        templateUrl: "/Templates/Include-Templates/navigation-list.html",
        link: function (scope, element, attrs, controller) {
           // console.log($(".navList:first-child"));
            $(".navList li:first-child").addClass( "active" );
        },
        controller: function ($scope) {
            $scope.changeActive = function ($event) {
                $(".active").removeClass("active");          
                var targ = $event.target.parentElement;
                $(targ).addClass("active");
            };

            $scope.logoutUser = function () {
                logoutSvc.logoutUser();
                $(".active").removeClass("active");
                $(".navList li:first-child").addClass("active");
            };
        }
    };
});